package com.xing.yunji.model.enums;

import io.swagger.models.auth.In;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 17916
 */

public enum TeamTypeEnum {
    PUBLIC(0,"公开"),
    PRIVATE(1,"私有"),
    SECRET(2,"加密");

    public static List<Integer> getTeamTypeEnumValues(){
        ArrayList<Integer> list = new ArrayList<>();
        for (TeamTypeEnum teamTypeEnum : TeamTypeEnum.values()) {
            list.add(teamTypeEnum.getValue());
        }
        return list;
    }

    public static  TeamTypeEnum getPublic(){
        return PUBLIC;
    }
    public static TeamTypeEnum getPrivate(){
        return PRIVATE;
    }
    public static TeamTypeEnum getSecret(){
        return SECRET;
    }

    public static TeamTypeEnum getEnumByValue(Integer value){
        if(value==null){
            return null;
        }
        TeamTypeEnum[] values = TeamTypeEnum.values();
        for (TeamTypeEnum teamTypeEnum : values) {
            if(teamTypeEnum.getValue().equals(value)){
                return teamTypeEnum;
            }
        }
        return null;
    }

    private Integer value;
    private String text;

    TeamTypeEnum(int value, String text) {
        this.value = value;
        this.text = text;
    }

    public Integer getValue() {
        return value;
    }

    public String getText() {
        return text;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public void setText(String text) {
        this.text = text;
    }
}
